<template>
  <div class="container">
    <h2>App组件</h2>
    <button @click="getRight">获取子组件</button>
    <my-left></my-left>
    <my-right ref="myright"></my-right>
  </div>
</template>

<script>
import MyLeft from './components/MyLeft.vue'
import MyRight from './components/MyRight.vue'
export default {
  methods: {
    getRight () {
      this.$refs.myright.show()
    }
  },
  components:{ MyLeft, MyRight }
}
</script>